package org.jeecg.modules.demo.membermanagement.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import org.jeecg.modules.demo.membermanagement.entity.MemberInfo;
import org.jeecg.modules.demo.membermanagement.entity.MemberManagement;
import org.jeecg.modules.demo.membermanagement.entity.MyMemberInfo;

import java.util.List;
import java.util.Map;

/**
 * @Description: 会员管理
 * @Author: jeecg-boot
 * @Date: 2022-01-14
 * @Version: V1.0
 */
public interface MemberManagementMapper extends BaseMapper<MemberManagement> {
    /**
     * 根据id查询会员信息
     *
     * @param storeId
     * @param memberId
     * @return
     */
    MemberInfo getMemberinfoById(@Param("storeId") String storeId, @Param("memberId") String memberId);

    /**
     * 查询我的客源
     *
     * @param storeId
     * @param stockId
     * @return
     */
    List<MyMemberInfo> getMyMemberList(@Param("pageNo") Integer pageNo, @Param("pageSize") Integer pageSize, @Param("storeId") String storeId, @Param("stockId") String stockId);

    void updateMemberType(@Param("memberType") String memberType, @Param("stockId") String stockId);

    List<MemberManagement> getNotStockMember(@Param("storeId") String storeId);

    void deleteRelationStock(@Param("stockId") String stockId);

    void updateMemberTypeByStockId(@Param("stockId") String stockId);

    List<Map<String, Object>> listMemberProject(@Param("map") Map<String, Object> map);

    MemberManagement getOneRecord(@Param("storeId") String storeId, @Param("unionId") String unionId);

    MemberManagement getOneRecordByUnionId(@Param("storeId") String storeId, @Param("unionId") String unionId);

    List<MemberManagement> getRelationsAll(@Param("id") String id, @Param("storeId") String storeId);

    List<MemberManagement> getRelations(@Param("id") String id, @Param("storeId") String storeId);

    void updateStockId(@Param("stockId") String stockId, @Param("id") String id);

    void updateRelationQty(@Param("id") String id, @Param("relationQty") Integer relationQty);

    Integer getRelationsAllQty(@Param("id") String id, @Param("storeId") String storeId);

}